<template>
  <div>
    <TopBack title="收藏"></TopBack>
     <div v-for="(item, index) in hotelData" :key="index" class="box">
        <van-card
          :desc="item[0].hotelType"
          :title="item[0].name"
          :thumb="item[0].indexImage"
          tag="双旦人气酒店"
        >
      
          <template #tags>
            <van-tag plain type="danger" class="fenshu">{{ item[0].num }}</van-tag>
            <van-tag plain type="danger" class="fenshuall">{{
              item[0].desc
            }}</van-tag>
            <van-tag plain type="danger" class="fenshuall"
              >{{ item.pinglunCount }}+消费</van-tag
            >
          </template>
          <template #price>
            <span>{{ item[0].adress }}</span>
          </template>
          <template #footer>
            <span class="fubiao"
              >￥{{ item[0].minPrice }} </span
            >起
              <van-button @click="removeCollect" type="info" size="mini">取消收藏</van-button>
          </template>
        </van-card>
      </div>
  </div>
</template>

<script>
import TopBack from '../../components/TopBack'
export default {
  components:{
    TopBack
  },
  data(){
    return{
      hotelData:[],
    }
  },
beforeMount(){
    this.$bus.$on('addHotel',(data)=>{
    })     
 },
 mounted(){
  this.hotelData = this.$bus.$hotel
  if(this.hotelData == undefined){
    return false
  }
 },
 methods:{
   removeCollect(){
     this.hotelData.splice(this,1)
   }
 }
}
</script>

<style lang="less" scoped>
.van-card{
  border-radius: 10px;
  margin:10px;
}
.top {
  background-color: #f5f6f8;
  left: 3%;
  right: 3%;
  height: 6%;
  padding: 5px 2%;
  margin: 10px;
  height: 20px;
  line-height: 20px;
}

.van-cell {
  padding: 0;
  background-color: #f5f6f8;
  //   height: 20px;
}

.van-cell--required::before {
  content: "";
}
.van-search {
  padding: 0;
  margin-top: 2px;
}
.fengexian {
  width: 2px;
  height: 10px;
}
.van-card__title {
  font-size: 16px;
  font-weight: 600;
}
.fenshu {
  background-color: #033e98;
  border: 0;
  color: #fff;
  border-radius: 5px 0 5px 5px;
  margin-right: 5px;
}
.fenshuall {
  border: 1px solid #fff;
  margin-right: 5px;
  color: #033e98;
}
.van-card__tag {
  position: absolute;

  left: 0;
  top: 1.8rem;
}
.van-card__desc {
  margin-top: 5px;
}
.van-tag {
  margin-top: 5px;
}
.fubiao{
  font-size: 16px; color: red
}
.thison{
font-size: 13px; margin-top: 5px
}
.thison1{
margin-left: 2px; margin-top: -25px
}
.thison2{
  margin-left: 8px; margin-top: -25px
}
.shaixuan{
  margin-top: 10px; border-bottom: 1px solid #ccc
}
</style>
